mod sgd;
mod momentum;
mod adagrad;
mod rmsprop;
mod adam;

pub use sgd::SDG;
pub use momentum::Momentum;
pub use adagrad::Adagrad;
pub use rmsprop::RMSprop;
pub use adam::Adam;

use crate::Var;

pub trait Optim {
    fn step(&mut self);
    fn parameters(&self) -> impl Iterator<Item = &Var>;
    fn zero_grad(&self) {
        for params in self.parameters() {
            params.zero_gard();
        }
    }
}
